package org.hao.samples.test;

import org.hao.samples.dao.IRoleDAO;
import org.hao.samples.model.Role;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({ "file:WebContent/WEB-INF/viewspace-servlet.xml" })
public class testRole {
	@Autowired
	private IRoleDAO dao;

	@Test
	public void test() {
		System.out.println(dao.findRoleById(2015222).getRoleId());
	}

	@Test
	public void test1() {
		dao.deleteRole(2015222);
	}

	@Test
	public void test2() {
		Role entity = new Role();
		entity.setRoleId(2);
		entity.setUserId(2015999);
		dao.createRole(entity);
	}
}
